/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"9C6E8523-00B9-4D93-84AD-A909EFD60A5A"}
 */
function imprimir(event) {
	forms.oc_cabecera_imp_ind.controller.loadRecords(oc_cabecera_id)
	forms.oc_cabecera_imp_ind.controller.showPrintPreview()
}

/**
 * @properties={typeid:24,uuid:"047D403F-2019-4B09-91C5-48FB678A0F3B"}
 */
function imprimePdf()
{
	forms.oc_cabecera_imp_ind.controller.loadRecords(oc_cabecera_id)
	globals.metodoPdf('oc_cabecera_imp_ind', 'ordenes_compra', false)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5426210A-4F80-474F-ADE8-40745AC26F66"}
 */
function anular(event) {
	oc_cabecera_to_oc_detalle_ind.deleteAllRecords()
	oc_estado = 2
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"CF74A655-7B36-4D03-BF7E-A36312A3126F"}
 */
function onRecordSelection(event) {
	if (oc_estado == 1)
		elements.btn_eliminar.visible = 0
	else
		elements.btn_eliminar.visible = 1
}
